<div class="content_eee">
    <div class="register">
        <div class="register_s">
            <div class="anquan">
                <h1>悠奇网安全中心</h1><i>-</i><h2>找回密码</h2>
                <span><a href="/user/login">返回登录页</a></span>
            </div>
            <div class="buzhou">
                <ul>
                    <li class="lv">1. 输入注册邮箱</li>
                    <li>2. 进邮箱验证身份</li>
                    <li>3. 重置密码</li>
                    <li>4. 完成</li>
                </ul>
            </div>
            <div class="zhanghao">     
                <form id="form1" action="" method="post">       
                    <table>
                        <tr>
                            <td class="zuo">请输入您的E-mail地址：</td>
                            <td>
                                <div class="input">                            	
                                    <input type="text" onchange="check_form()" id="email" name="email" />&nbsp;<label><font color="red">*</font></label><label id="emailMsg" for="newpostcode" generated="true" class="error" style="display: none; "></label>
                                </div>
                            </td>
                        </tr>            
                    </table>
                    <div class="submit">
                        <a class="next" href="javascript:form_submit();"><span>下一步</span></a>
                    </div>
                    <div class="bzone">
                        <h2>关于找回密码</h2>
                        <p>您只需提交您的登录邮箱，然后进入您的邮箱点击悠奇网发送给您的验证链接即可找回密码！</p>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script language="javascript">
    function change()
    {
        document.getElementById("chkImg").src ="/che.php?"+Math.random();
    }

    function form_submit()
    {
        if(check_form())
        {
            var username = $("#username").val();
            var email = $("#email").val();
            var check_code = $("#check_code").val();
            //$("#form1").submit();return;
            jQuery.ajax({
                type: "POST",
                url: "/user/retakepassword/",
                data: {"username":username,"email":email,"check_code":check_code},
                dataType:"json",
                success: function(obj){
                    if(obj.ret == 1)
                    {
                        window.location.href = "/user/retakepasswordtwo";
                    }
                    else
                    {
                        switch(obj.ret)
                        {
                            case -1:
                                $("#emailMsg").html("验证码不正确");
                                $("#emailMsg").show();
                                break;
		    				
                            case -2:
                                $("#emailMsg").html("用户名与注册邮箱地址不匹配");
                                $("#emailMsg").show();
                                break;
                                                
                            case -255:
                                $("#emailMsg").html("注册邮箱地址不存在");
                                $("#emailMsg").show();
                                break;
                        }
                    }
                }
            });
        }
    }

    function check_form()
    {
	

        if($("#email").val() == "")
        {
            $("#emailMsg").html("必填项");
            $("#emailMsg").show();

            return false;
        }
        else
        {
            $("#emailMsg").html("");
            $("#emailMsg").hide();
        }	


        return true;
    }
</script>